package com.ruoyi.yljf.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.yljf.mapper.EnlightMapper;
import com.ruoyi.yljf.domain.Enlight;
import com.ruoyi.yljf.service.IEnlightService;

import javax.annotation.Resource;

/**
 * 启智订单Service业务层处理
 * 
 * @author metaee
 * @date 2025-03-26
 */
@Service
public class EnlightServiceImpl extends ServiceImpl<EnlightMapper, Enlight> implements IEnlightService {
    @Resource
    private EnlightMapper enlightMapper;
    
    /**
     * 查询启智订单列表
     * 
     * @param enlight 启智订单
     * @return 启智订单
     */
    @Override
    public List<Enlight> selectEnlightList(Enlight enlight) {
    	LambdaQueryWrapper<Enlight> queryWrapper = Wrappers.lambdaQuery();
        if (StringUtils.isNotEmpty(enlight.getNumber())) {
			queryWrapper.eq(Enlight::getNumber, enlight.getNumber());
		}
        if (StringUtils.isNotNull(enlight.getUserId())) {
			queryWrapper.eq(Enlight::getUserId, enlight.getUserId());
		}
        if (StringUtils.isNotNull(enlight.getStatus())) {
			queryWrapper.eq(Enlight::getStatus, enlight.getStatus());
		}
        if (StringUtils.isNotNull(enlight.getDishId())) {
			queryWrapper.eq(Enlight::getDishId, enlight.getDishId());
		}
        if (StringUtils.isNotEmpty(enlight.getName())) {
			queryWrapper.like(Enlight::getName, enlight.getName());
		}
        if (StringUtils.isNotEmpty(enlight.getMessage())) {
			queryWrapper.eq(Enlight::getMessage, enlight.getMessage());
		}
        if (StringUtils.isNotNull(enlight.getAmount())) {
			queryWrapper.eq(Enlight::getAmount, enlight.getAmount());
		}
        if (StringUtils.isNotNull(enlight.getCheckoutTime())) {
			queryWrapper.eq(Enlight::getCheckoutTime, enlight.getCheckoutTime());
		}
        if (StringUtils.isNotNull(enlight.getFinishTime())) {
			queryWrapper.eq(Enlight::getFinishTime, enlight.getFinishTime());
		}
        return enlightMapper.selectList(queryWrapper);
    }
}
